/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.qframe.client.gwtcustom;

import com.google.gwt.dom.client.NodeList;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 *
 * @author gprasad
 */
public class QuickletHTMLPanel extends HTMLPanel {

    public QuickletHTMLPanel(String html) {
        super(html);
    }

    public void addToLocal(Widget widget, String divID) {

        NodeList<com.google.gwt.dom.client.Element> nodes = getElement().getElementsByTagName("DIV");
        int noOfNodes = nodes.getLength();
        Element ele = null;
        for (int i = 0; i < noOfNodes; i++) {
            String tempId = nodes.getItem(i).getId();
            if (divID.equals(tempId)) {
                ele = (Element) nodes.getItem(i);
                break;
            }
        }

        super.add(widget, ele);
    }
}
